package com.blb.service.impl;

import com.blb.entity.Sort;
import com.blb.mapper.SortMapper;
import com.blb.service.ISortService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author wss
 * @since 2020-05-22
 */
@Service
public class SortServiceImpl extends ServiceImpl<SortMapper, Sort> implements ISortService {

    @Resource
    private SortMapper SortMapper;

    /**
     * 增加一级分类
     *
     * @param sort
     * @return
     */
    @Override
    public int addSort(Sort sort) {
        return SortMapper.addSort(sort);
    }

    /**
     * 增加二级分类
     *
     * @param sort
     * @return
     */
    @Override
    public int addSorts(Sort sort) {
        return SortMapper.addSorts(sort);
    }

    /**
     * 增加三级分类
     *
     * @param sort
     * @return
     */
    @Override
    public int addSortss(Sort sort) {
        return SortMapper.addSortss(sort);
    }

    /**
     * 分类查询
     *
     * @return
     */
    @Override
    public List<Sort> sortAll(String companyId) {
        return SortMapper.sortAll(companyId);
    }

    /**
     * 根据id查询
     *
     * @param id
     * @return
     */
    @Override
    public Sort sortById(String id,String companyId) {
        return SortMapper.sortById(id,companyId);
    }

    @Override
    public int sortByIds(String id) {
        return SortMapper.sortByIds(id);
    }

    @Override
    public int sortByName(String sortName,String companyId) {
        return SortMapper.sortByName(sortName,companyId);
    }


}
